<?php

namespace App\Http\Requests\Admin;

use App\Http\Requests\ApiRequest;

/**
 * @property string telephone
 * @property string email
 * @property int qq
 * @property string address
 * @property string time
 * @property string company
 * @property string fax
 * @property string website
 * @property string business_concepts
 * @property string business_miss
 * @property string business_spirit
 * @property string about_us
 * @property string contact_us
 */
class AboutUsStoreRequest extends ApiRequest
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
            'telephone'         => 'required|string',
            'email'             => 'required|email',
            'qq'                => 'required|numeric',
            'address'           => 'required|string',
            'time'              => 'required|string',
            'company'           => 'required|string',
            'fax'               => 'required|string',
            'website'           => 'required|url',
            'business_concepts' => 'required|string',
            'business_miss'     => 'required|string',
            'business_spirit'   => 'required|string',
            'about_us'          => 'required|string',
            'contact_us'        => 'required|string',
        ];
    }

    /**
     * @return array
     */
    public function messages()
    {
        return [
            'telephone.*'         => '联系电话必须是字符串',
            'email.*'             => '联系邮箱必须是合法的邮箱',
            'qq.*'                => '联系QQ必须是数值',
            'address.*'           => '联系地址必须是字符串',
            'time.*'              => '工作时间必须是字符串',
            'company.*'           => '公司名称必须是字符串',
            'fax.*'               => '公司传真必须是字符串',
            'website.*'           => '公司网址必须是合法的地址',
            'business_concepts.*' => '经营理念必须是字符串',
            'business_miss.*'     => '企业使命必须是字符串',
            'business_spirit.*'   => '企业精神必须是字符串',
            'about_us.*'          => '关于我们的详情必须是富文本字符串',
            'contact_us.*'        => '联系我们的详情必须是富文本字符串',
        ];
    }
}
